/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package action.Management;

import Database.UserDAO;
import Models.User;
import static com.opensymphony.xwork2.Action.SUCCESS;
import com.opensymphony.xwork2.ActionSupport;
import java.util.List;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;

/**
 *
 * @author trang_000
 */
@Namespace("/")
public class ManageUserAction extends ActionSupport{
    public List<User> usersList;
    private UserDAO userDAO = new UserDAO();

    public List<User> getUsersList() {
        return usersList;
    }

    public void setUsersList(List<User> usersList) {
        this.usersList = usersList;
    }
    
     @Action(value = "all-user", results = {
        @Result(name = "success", location = "/Management/ManageUserPage.jsp")      
    })
    public String management(){
       // profilesList = manageDAO.getAllProfile();
        usersList = userDAO.getUser();
        System.out.println(usersList.size());
        return SUCCESS;
    }
}
